<template>
  <v-page style="background: #fff;padding: 32px;">
    <saveForm ref="saveItemForm" :patch-data="currentItem"></saveForm>
    <el-button type="primary" @click="saveTem()" style="width: 100px">保存</el-button>
  </v-page>
</template>

<script>
import { getConfig, saveOrUpdate } from '#/api/pConfig';
import saveForm from "./saveForm";

export default {
  components: {saveForm},
  created() {
    getConfig().then(res => {
        this.currentItem = res.data;
    })
  },
  data() {
    return {
      currentItem: {},
    };
  },
  computed: {},
  methods: {
    saveTem() {
      this.$refs.saveItemForm.validate((data) => {
        console.log(data)
        saveOrUpdate(data).then(res => {
          this.toast("保存成功", "success");
        })
      });
      
    },
  },
};
</script>

<style lang="scss">

</style>